using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Windows;

//��ɫ����״̬
public class PlayerIdleState : PlayerGroundedState
{
    public PlayerIdleState(Player _player, PlayerStateMachine _playerStateMachine, string _animBoolName) : base(_player, _playerStateMachine, _animBoolName)
    {

    }

    public override void Enter()
    {
        base.Enter();

        player.currentJumpCount = 0;

        rb.velocity = new Vector2(0, rb.velocity.y);
    }

    public override void Update()
    {
        base.Update();

        if (player.IsWallDetected() && xInput == player.facingDir)
            return;

        if (xInput != 0 && player.IsGroundDetected())
            player.stateMachine.ChangeState(player.moveState);
    }

    public override void Exit()
    {
        base.Exit();
    }
}
